package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsCheckPlanVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 盘点计划 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-01
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsCheckPlan extends BaseEntity<AssetsCheckPlanVO> {

    private static final long serialVersionUID = 1L;
    public AssetsCheckPlan(AssetsCheckPlanVO vo){
        this.planId = vo.getPlanId();
        this.planName = vo.getPlanName();
        this.planType = vo.getPlanType();
        this.categoryList = vo.getCategoryList();
        this.beginDate = vo.getBeginDate();
        this.endDate = vo.getEndDate();
        this.planState = vo.getPlanState();
        this.reviewUserId = vo.getReviewUserId();
        this.reviewUser = vo.getReviewUser();
        this.createTime = vo.getCreateTime();
        this.createUserId = vo.getCreateUserId();
        this.createUser = vo.getCreateUser();
        this.editorTime = vo.getEditorTime();
        this.editorUserId = vo.getEditorUserId();
        this.editorUser = vo.getEditorUser();
        this.schedule = vo.getSchedule();
        this.aCount = vo.getACount();
        this.pCount = vo.getPCount();
        this.reviewProgress = vo.getReviewProgress();
    }

    @Override
    public AssetsCheckPlanVO convertToVO(){
        return new AssetsCheckPlanVO(this);
    }


    /**
     * 盘点计划ID
     */
    @TableId(value = "plan_id", type = IdType.ASSIGN_UUID)
    private String planId;

    /**
     * 计划名称
     */
    private String planName;

    /**
     * 计划类型(1区域 2部门 )
     */
    private Integer planType;

    /**
     * 资产类别(可多类别，所有类别时为空)
     */
    private String categoryList;

    /**
     * 计划开始日期
     */
    private String beginDate;

    /**
     * 计划结束日期
     */
    private String endDate;

    /**
     * 计划状态(0正常1结束2过期3终止)
     */
    private Integer planState;

    /**
     * 盘点结果审核人ID
     */
    private String reviewUserId;

    /**
     * 盘点结果审核人
     */
    private String reviewUser;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人ID
     */
    private String createUserId;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 编辑时间
     */
    private Date editorTime;

    /**
     * 编辑人ID
     */
    private String editorUserId;

    /**
     * 编辑人
     */
    private String editorUser;

    /**
     * 盘点总进度
     */
    @TableField(exist = false)
    private Double schedule;

    /**
     * 盘点人数
     */
    @TableField(exist = false)
    private Integer pCount;

    /**
     * 资产总数
     */
    @TableField(exist = false)
    private Integer aCount;

    /**
     * 审核进度
     */
    @TableField(exist = false)
    private Double reviewProgress;


    public enum ColName {
        plan_id, plan_name, plan_type, category_list, begin_date, end_date, plan_state, review_user_id, review_user, create_time, create_user_id, create_user, editor_time, editor_user_id, editor_user, 
    }
}
